package com.zq.learn.springbatch.combination.quartz;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * Task2
 *
 * @author ZhangQi
 * @date 2020/2/19
 */
@Component
public class TestTask implements Job {
  private Logger log= LoggerFactory.getLogger(TestTask.class);

  @Override public void execute(JobExecutionContext jobExecutionContext)
    throws JobExecutionException {
    log.info("测试 ，我将执行2s钟， 线程名字 == > {} , 现在时间为 == > {}", Thread.currentThread().getId(),new Date());
    try {
      Thread.sleep(2000);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
    System.out.println(".....");
  }
}
